package org.micro.rbac.core.valid;


import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.micro.rbac.core.constant.Global;
import org.micro.rbac.core.valid.validator.DateTimeValidator;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author hongsir
 * @apiNote 摘要:
 * @since 2019-05-29 08:53
 */
@Target({FIELD, PARAMETER})
@Retention(RUNTIME)
@Constraint(validatedBy = DateTimeValidator.class)
public @interface DateTime {

    String message() default "日期格式错误";

    String[] format() default {Global.DATE_FORMAT};

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
